import {TOKEN_TIME, TOKEN_TIME_VALUE} from './constant'

// 登录时 设置时间
export const setTokenTime = () => {
  localStorage.setItem(TOKEN_TIME, Date.now());
}

export const  getTokenTime =()=>{
  return localStorage.getItem(TOKEN_TIME);
}

export const  difTokenTime = ()=>{
  const curTime = Date.now();
  const logTime = getTokenTime();
  return curTime - logTime > TOKEN_TIME_VALUE;
}
